<template>
    <div>
        <div class="tabs-content-box">
            <el-table :data="newsList" :show-header="false" style="width: 100%;font-size:14px;">
                <el-table-column width="40">
                    <template slot-scope="scope">
                        <div class="todo-tag" v-bind:class="'todo-tag-'+(scope.$index+1)">{{scope.$index+1}}</div>
                    </template>
                </el-table-column>
                <el-table-column show-overflow-tooltip>
                    <template slot-scope="scope">
                        <div class="todo-item">
                            <a href="#" title="" @click="openMenuFunction(scope.row)"><span style="margin-right:10px;">{{scope.row.typeId==='30021'?scope.row.deptFeedState==='0'?'未反馈':'已反馈':scope.row.readStatus==='0'?'未阅读':'已阅读'}}</span>{{scope.row.name}}</a>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column width="110" show-overflow-tooltip>
                    <template slot-scope="scope" >
                        {{scope.row["deptName"]}}
                    </template>
                </el-table-column>
                <el-table-column width="102">
                    <template slot-scope="scope">
                        <div class="todo-date">{{scope.row["publishTime"]}}</div>
                    </template>
                </el-table-column>
            </el-table>
        </div>
    </div>
</template>
<script>
import bus from '../../common/bus';
export default {
    name: 'ArticleTemplate',
    props:['newsList','name'],
    data () {
        return {
            articleDetail:'./articleDetail.html'
        };
    },
    methods: {
        // deptFeedState  反馈状态

        // 打开详情页面
        openMenuFunction(item){
            let url = this.articleDetail+'?typeId=' + item.typeId + '&articleId='+ item.id;
            // window.open(url, '_blank');
            let menu = {
                url:url,
                name:this.name,
                isNew:false // 是否在新页面打开
            };
            if(item.typeId === '30021'){
                let routeData = this.$router.resolve({
                    path: '/FeedbackDetail',
                });
                menu.url = window.location.href.split('#')[0]+routeData.href+'?typeId=' + item.typeId + '&articleId='+ item.id;
            }      
            bus.$emit('openMenu',menu);
        },
    },
};
</script>

<style lang="scss" scoped>
.tabs-content-box{
        padding: 0!important;
    }

</style>
